import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'
import intl from 'react-intl-universal'
import './GoBack.less'

class GoBack extends Component {

  handleGoBack = (e) => {
    e.preventDefault()
    e.stopPropagation()
    const { history } = this.props
    history.goBack()
  }

  render () {
    return (
      <div id = {'go-back'}>
        <h2>
          <a onClick = {this.handleGoBack}
             href = {'javascript:void(0)'}>{intl.get('goback')}</a>
        </h2>
      </div>
    )
  }
}

export default withRouter(GoBack)
